<html>
    <head>
        <link rel="stylesheet" type="text/css" href="style.css">
        <link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Rokkitt&display=swap" rel="stylesheet">
<script src=FileSaver.js></script>
<script>
    function HSC_Generate(){
               var sub1=document.getElementById('s1').value;
               var sub2=document.getElementById('s2').value;
               var sub3=document.getElementById('s3').value;
               var sub4=document.getElementById('s4').value;
               var sub5=document.getElementById('s5').value;
               var sub6=document.getElementById('s6').value;
               var demo=document.getElementById('demo').value;
               var name=document.getElementById('name').value;
               var content="Ashwin's Percentage Calculator (Higher Secondary)"+"\n"+"\n"+"Marks obtained for Subject 1:" + sub1+"\n"+"Marks obtained for Subject 2:" + sub2+"\n"+"Marks obtained for Subject 3:"+ sub3+"\n"+"Marks obtained for Subject 4:"+ sub4+"\n"+"Marks obtained for Subject 5:"+ sub5+"\n"+"Marks obtained for Subject 6:"+ sub6+"\n"+"\n"+"At finally,"+demo+" ";
               var blob=new Blob([content],{type:"text/plain;charset=utf-8"});
               saveAs(blob,name);
            }
</script>
<script src=FileSaver.js></script>
<script>
        function SSLC_Generate(){
                   var v1=document.getElementById('v1').value;
                   var v2=document.getElementById('v2').value;
                   var v3=document.getElementById('v3').value;
                   var v4=document.getElementById('v4').value;
                   var v5=document.getElementById('v5').value;
                   var demo1=document.getElementById('demo1').value;
                   var name1=document.getElementById('name1').value;
                   var content1="Ashwin's Percentage Calculator (SSLC)"+"\n"+"\n"+"Marks obtained for Subject 1:" + v1+"\n"+"Marks obtained for Subject 2:" + v2+"\n"+"Marks obtained for Subject 3:" + v3+"\n"+"Marks obtained for Subject 4:" + v4+"\n"+"Marks obtained for Subject 5:" + v5+"\n"+"\n"+"At finally,"+demo1+" ";
                   var blob1=new Blob([content1],{type:"text/plain;charset=utf-8"});
                   saveAs(blob1,name1);
                }
        </script>
<script type="text/javascript">
        function HSC_percentage(){
        if(document.getElementById('s1').value==""){
            window.alert("Enter Subject 1 mark");
            return false;
        }
        else if(document.getElementById('s2').value==""){
            window.alert("Enter Subject 2 mark");
            return false;
        }
        else if(document.getElementById('s3').value==""){
            window.alert("Enter Subject 3 mark");
            return false;
        }
        else if(document.getElementById('s4').value==""){
            window.alert("Enter Subject 4 mark");
            return false;
        }
        else if(document.getElementById('s5').value==""){
            window.alert("Enter Subject 5 mark");
            return false;
        }
        else if(document.getElementById('s6').value==""){
            window.alert("Enter Subject 6 mark");
            return false;
        }
        if(document.getElementById('s1').value>200){
            window.alert("Invalid Mark in Subject 1 :(");
            return false;
        }
        else if(document.getElementById('s1').value<0){
            window.alert("Please enter the positive value in Subject 1 :(");
            return false;

        }
        if(document.getElementById('s2').value>200){
            window.alert("Invalid Mark in Subject 2:(");
            return false;
        }
        else if(document.getElementById('s2').value<0){
            window.alert("Please enter positive value in Subject 2 :(");
            return false;
        }
        if(document.getElementById('s3').value>200){
            window.alert("Invalid Mark in Subject 3 :(");
            return false;
        }
        else if(document.getElementById('s3').value<0){
            window.alert("Please enter positive value in Subject 3 :(");
            return false;
        }
        if(document.getElementById('s4').value>200){
            window.alert("Invalid Mark in Subject 4 :(");
            return false;
        }
        else if(document.getElementById('s4').value<0){
            window.alert("Please enter positive value in Subject 4 :(");
            return false;
        }
        
        if(document.getElementById('s5').value>200){
            window.alert("Invalid Mark in Subject 5 :(");
            return false;
        }
        else if(document.getElementById('s5').value<0){
            window.alert("Please enter positive value in Subject 5 :(");
            return false;
        }
        if(document.getElementById('s6').value>200){
            window.alert("Invalid Mark in Subject 6");
            return false;
        }
        else if(document.getElementById('s6').value<0){
            window.alert("Please enter positive value in Subject 6 :(");
            return false;
        }
        var a=parseInt(document.getElementById('s1').value);
        var b=parseInt(document.getElementById('s2').value);
        var c=parseInt(document.getElementById('s3').value);
        var d=parseInt(document.getElementById('s4').value);
        var e=parseInt(document.getElementById('s5').value);
        var f=parseInt(document.getElementById('s6').value);
        var total=a+b+c+d+e+f;
        var per=(total/1200)*100;
        document.getElementById("demo").innerHTML = "You have "+per+"%";
        }
        function SSLC_percentage(){
            if(document.getElementById('v1').value==""){
            window.alert("Enter Subject 1 mark");
            return false;
        }
        else if(document.getElementById('v2').value==""){
            window.alert("Enter Subject 2 mark");
            return false;
        }
        else if(document.getElementById('v3').value==""){
            window.alert("Enter Subject 3 mark");
            return false;
        }
        else if(document.getElementById('v4').value==""){
            window.alert("Enter Subject 4 mark");
            return false;
        }
        else if(document.getElementById('v5').value==""){
            window.alert("Enter Subject 5 mark");
            return false;
        }
        
        if(document.getElementById('v1').value>100){
            window.alert("Invalid Mark in Subject 1 :(");
            return false;
        }
        else if(document.getElementById('v1').value<0){
            window.alert("Please enter the positive value in Subject 1 :(");
            return false;

        }
        if(document.getElementById('v2').value>100){
            window.alert("Invalid Mark in Subject 2:(");
            return false;
        }
        else if(document.getElementById('v2').value<0){
            window.alert("Please enter positive value in Subject 2 :(");
            return false;
        }
        if(document.getElementById('v3').value>100){
            window.alert("Invalid Mark in Subject 3 :(");
            return false;
        }
        else if(document.getElementById('v3').value<0){
            window.alert("Please enter positive value in Subject 3 :(");
            return false;
        }
        if(document.getElementById('v4').value>100){
            window.alert("Invalid Mark in Subject 4 :(");
            return false;
        }
        else if(document.getElementById('v4').value<0){
            window.alert("Please enter positive value in Subject 4 :(");
            return false;
        }
        
        if(document.getElementById('v5').value>200){
            window.alert("Invalid Mark in Subject 5 :(");
            return false;
        }
        else if(document.getElementById('v5').value<0){
            window.alert("Please enter positive value in Subject 5 :(");
            return false;
        }
        var v1=parseInt(document.getElementById('v1').value);
        var v2=parseInt(document.getElementById('v2').value);
        var v3=parseInt(document.getElementById('v3').value);
        var v4=parseInt(document.getElementById('v4').value);
        var v5=parseInt(document.getElementById('v5').value);
        var total=v1+v2+v3+v4+v5;
        var per=(total/500)*100;
        document.getElementById("demo1").innerHTML = "You have "+per+"%";
        }
</script>
    </head>
    <body>
        <div class="space">
            <center>
                <h2><font color="crimson" size="17px">
                        <span>/ * = </span>#Win's Percentage Calculator <span>+ - x %</span>
                    </font>
                </h2>
            </center>
        </div>
        <div class="row">
        <div class="column">
    <div id="HSC">
        <form action="#">
            <fieldset>
        <div class="hschead"><center><h1><b><font color="white">Higher Secondary</font></b></h1></center></div>
        <center><h2><font color="white" >Subject 1: <b><input type="text" id="s1" size="30">
     </b></font></h2> </center>
    <center><h2><font color="white">Subject 2: <b><input type="text" size="30" id="s2" >
     </b></font></h2>
        </center>
        <center><h2><font color="white">Subject 3: <b><input type="text" size="30"id="s3" >
        </b></font></h2>
           </center>
           <center><h2><font color="white">Subject 4: <b><input type="text" size="30"id="s4">
           </b></font></h2> </center>
           <center><h2><font color="white">Subject 5: <b><input type="text" size="30" id="s5" >
           </b></font></h2></center>
           <center><h2><font color="white">Subject 6: <b><input type="text" size="30" id="s6">
           </b></font></h2></center>
           <center><input type="submit" onclick="HSC_percentage()"></center>
          <center> <textarea id="demo" row="5" column="12"></textarea></center>
        <center><input type="reset" value="Reset" id="Reset">  </center> <br>
             <div class="download">
                 <center><font color="yellow">Don't forgot to save your work :)</font></center><br>
                <center><input type="text" size="30" id="name" placeholder="File Name"> <button type="submit" onclick="HSC_Generate()">Download</button></center>

             </div>
            </fieldset></form></div>
        </div>   
        <div class="column">
              <div class="SSLC">
                  <form action="#">
                    <fieldset>
               <div class="sslchead"> <center><h1><b><font color="white">SSLC</font></b></h1></center></div>
<center><h2><font color="white" >Subject 1: <b><input type="text" id="v1" size="30">
     </b></font></h2> </center>
     <center><h2><font color="white">Subject 2: <b><input type="text" size="30" id="v2" >
     </b></font></h2>
        </center>
        <center><h2><font color="white">Subject 3: <b><input type="text" size="30"id="v3" >
        </b></font></h2>
           </center>
           <center><h2><font color="white">Subject 4: <b><input type="text" size="30"id="v4">
           </b></font></h2> </center>
           <center><h2><font color="white">Subject 5: <b><input type="text" size="30" id="v5" >
           </b></font></h2></center><br><br>
           
           <center><input type="submit" onclick="SSLC_percentage()"></center>
          <center> <textarea id="demo1" row="5" column="12"></textarea></center>
          <center><input type="reset" value="Reset" id="Reset1"></center><br>
          <div class="download1">
            <center><font color="yellow">Don't forgot to save your work :)</font></center><br>
           <center><input type="text" size="30" id="name1" placeholder="File Name"> <button type="submit" onclick="SSLC_Generate()">Download</button></center>
        </div></fieldset>
        </form></div>
 </div></div>
</body>
</html>